/*
 * motor.h
 *
 * Created: 2012/6/15 20:44:37
 *  Author: albert
 */ 


#ifndef MOTOR_H_
#define MOTOR_H_


#include <avr/io.h>
#include <util/delay.h>

#define forward 1
#define reverse  2
#define left 3
#define right  4

extern unsigned char motor_usart_num;
extern unsigned char motor_usart_speed; //0->9600db 1->38400db
extern volatile unsigned char pre_motor_mode;
extern volatile unsigned char current_motor_mode;
extern volatile unsigned int timer_counter;
extern volatile unsigned int spi_counter;

void go_forward(void);
void go_reverse(void);
void turn_left(void);
void turn_right(void);
void stop_motor(void);

#endif /* MOTOR_H_ */